using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
using Unity.VisualScripting;
//游戏入口脚本
public class GameUI : UIBase
{
    void Awake()
    {
        //弹窗
        UIManager.Instance.ShowTip("第" + GameApp.instance.level + "关", Color.blue);
        GameApp.instance.enemyMove = true;
        //开始游戏
        Register("设置").onClick = onSettingsBtn;

    }
    //设置
    private void onSettingsBtn(GameObject obj, PointerEventData pData)
    {
        UIManager.Instance.ShowTip("设置功能开发中，敬请期待!", Color.red, delegate ()
        {
            Debug.Log("提示");
        });
    }

    void Update()
    {
        transform.Find("属性/data/关卡").GetComponent<TextMeshProUGUI>().text = "第" + GameApp.instance.level + "关";
        transform.Find("属性/data/分数").GetComponent<TextMeshProUGUI>().text = "得分:" + GameApp.instance.score;
        transform.Find("属性/data/火力").GetComponent<TextMeshProUGUI>().text = "x" + GameApp.instance.explosionRange;
        transform.Find("属性/data/炸弹数").GetComponent<TextMeshProUGUI>().text = "x" + GameApp.instance.bombAmount;
        transform.Find("属性/data/移速").GetComponent<TextMeshProUGUI>().text = "x" + GameApp.instance.speed;
    }
}